<?php
 $data = LinkGen::getInstance(LinkGen::PRODUCT)->collectionLinkParts(array($product));
 $route = $data[$product['id']]['route'];
 $parts = $data[$product['id']];
 unset($parts['route']);
?>
<div class="tabs">
	<div class="tabstop">
		<div class="tabslinks">
			<ul>
				<?php
					// main product parameters

					$active = $sf_request->getParameter('action') != 'paramArticle' && 
                                                  $sf_request->getParameter('action') != 'comments'     &&
                                                  $sf_request->getParameter('action') != 'techInfo';
					include_partial('productPage/tabLabel', array(
						'link' => url_for($route, $parts),
						'label' => __('Tooteinfo'),
						'active' => $active)
					);

					if($active)get_partial('productPage/defaultTabContent', array('product' => $product));
				?>



				<?php foreach($parameterArticles as $index => $act): ?>
					<?php
						$active = $sf_request->getParameter('action') == 'paramArticle' && $sf_request->getParameter('id') == $act['id'];
						$arr = array(
						'link' => url_for($route, array_merge($parts, array(
										'action' => $act['action'],
										'id' => $act['id']))),
						'label' => $act['title'],
						'active' =>  $active );
						
						include_partial('productPage/tabLabel', $arr);
						// tab content is defined in action
					?>
				<?php endforeach; ?>
				<?php
					// tech info
					$active = $sf_request->getParameter('action') == 'techInfo';
					include_partial('productPage/tabLabel', array(
						'link' => url_for($route, array_merge($parts, array(
						'action' => 'techInfo'))),
						'label' => __('Tehniline info'),
						'active' => $active )
					);

					// tab content is defined in action
				?>
				<?php 
					// comments
					$active = $sf_request->getParameter('action') == 'comments';
					include_partial('productPage/tabLabel', array(
						'link' => url_for($route, array_merge($parts, array(
						'action' => 'comments'))),
						'label' => __('Arvamused'),
						'active' => $active )
					);

					// tab content is defined in action
				?>
				
				<div class="clear"></div>
			</ul>
		</div>
	</div>
	<div class="tabcenter">
		<?php include_slot('tabContent') ?>
	</div>
</div>